<template>
	<view class="container">
		<!-- 导航栏 -->
		<navView  title="社会资源"></navView>
		
		<!--主内容部分-->
		<view>
			<socialResourceList ref="socialResourceList" :curMaterial="curMaterial" @materialTypeChange="materialTypeChange"></socialResourceList>
		</view>
	</view>
</template>

<script>
	import socialResourceList from '../components/socialResourceList.vue'
	import navView from '../components/navView.vue'
	export default {
		components:{
			socialResourceList,
			navView,
		},
		data() {
			return {
				//当前选中的物料
				curMaterial: [],
			}
		},
		
		onLoad(option) {
			this.curMaterial = JSON.parse(option.defaultMaterial);
		},
		
		onReachBottom() {
			this.$refs.socialResourceList.loadMore();
		},
		
		methods: {
			//页面返回
			navBack() {
				uni.navigateBack();
			},
			
			//切换选中的物料类型
			materialTypeChange(e) {
				this.curMaterial = e;
			}
		}
	}
</script>
	
<style lang="scss" scoped>
	.container {
		background-color: #F5F5F5;
	}
	
	.mainContentView {
		padding: 30rpx;
	}
	
</style>
